package top 

import chisel3._
import chisel3.util._
import chisel3.experimental._

class VEC_Test1 extends Module{
    val io = IO(new Bundle{
        val input  = Input(Vec(8, UInt(8.W)))
        val output = Output(UInt(64.W)) 
    })
    io.output := io.input.asUInt
}

class VEC_Test2 extends Module{
    val io = IO(new Bundle{
        val input  = Input(UInt(64.W))
        val output = Output(Vec(8, UInt(8.W)))
    })
    for(i <- 0 until 8){ 
        io.output(i) := io.input( (i+1)*8 -1 , i*8)
    }
}

class VEC_Test3 extends Module{
    val io = IO(new Bundle{
        val input  = Input(UInt(64.W))
        val output = Output(UInt(64.W))
    })
    val Module_1 = Module(new VEC_Test1)
    val Module_2 = Module(new VEC_Test2)
    
    Module_2.io.input := io.input
    Module_1.io.input := Module_2.io.output
    io.output         := Module_1.io.output
}